package rpc

import (
	"cluster-cache/common"
	"cluster-cache/store"
	"net"
)

type CallFuture interface {
	WaitDone()
}

type RemoteFuture struct {
	pos  uint64
	seq  *common.AsyncSeq
	conn net.Conn
}

func (c *RemoteFuture) WaitDone() {
	c.seq.WaitDone(c.pos)
}

type FlushFuture struct {
	Index    uint64
	LogStore *store.MMapLog
}

func (f *FlushFuture) WaitDone() {
	f.LogStore.WaitFlush(f.Index)
}
